<table cellspacing='1'
       cellpadding='1'
       onmouseover="$('new_designers_<%= stage.project_id %>_type_<%= type.id %>_designer_<%= designer.id %>').show();"
       onmouseout="$('new_designers_<%= stage.project_id %>_type_<%= type.id %>_designer_<%= designer.id %>').hide();" >
  <tr>
    <th>工作项</th>
    <th>单价</th>
    <th>计费面积</th>
    <th>工作量</th>
    <th>发放</th>
    <th>指导</th>
    <th>类型</th>
    <th>难度</th>
    <th>修改</th>
    <th>应得</th>
    <th class='hidden'>
      <div class='crud'>
        <div id='new_designers_<%= stage.project_id %>_type_<%= type.id %>_designer_<%= designer.id %>' class='box' style='display:none;'>
        <%= link_to_remote '▶创建',
                  :update => "stage_#{stage.id}_type_#{type.id}_desgner_#{designer.id}_work_items",
                  :url => new_designer_work_item_url(:stage_id => stage.id,
                    :work_item_type_id => type.id,
                    :designer_id => designer.id
                  ),
                  :method => :get,
                  :html => {
                    :class => 'base_i'
                  }
          %>
        </div>
      </div>
    </th>
  </tr>
  <% designer.designer_work_items_by(:stage_id => stage.id, :work_item_type_id => type.id).each do |designer_work_item| %>
    <tr onmouseover="$('ud_designers_<%= designer_work_item.id %>').show();"
        onmouseout="$('ud_designers_<%= designer_work_item.id %>').hide();" >
      <td><%= designer_work_item.try(:work_item).try(:name) %></td>
      <td align='right'><%= designer_work_item.try(:work_item).try(:pay_unit) %></td>
      <td align='right'><%= designer_work_item.billing_area %></td>
      <td align='right'><%= designer_work_item.work_load %> %</td>
      <td align='right'><%= designer_work_item.provided_percent %> %</td>
      <td align='right'><%= designer_work_item.guided_percent %> %</td>
      <td align='right'><%= designer_work_item.type_num %> %</td>
      <td align='right'><%= designer_work_item.difficulty_num %> %</td>
      <td align='right'><%= designer_work_item.motify_num %> %</td>
      <td align='right' class='money'>￥<%= number_with_precision designer_work_item.should_be_payed, :precision => 1 %></td>
      <td class='hidden'>
        <div class='crud'>
          <div id='ud_designers_<%= designer_work_item.id %>' class='box' style='display:none;'>
            <%= link_to_remote '修改',
                      :update => "stage_#{stage.id}_type_#{type.id}_desgner_#{designer.id}_work_items",
                      :url => edit_designer_work_item_url(designer_work_item),
                      :method => :get,
                      :html => {
                        :class => 'base_i'
                      }
              %>
            <%= link_to_remote '删除',
                      :update => "stage_#{stage.id}_type_#{type.id}_desgner_#{designer.id}_work_items",
                      :url => designer_work_item_url(designer_work_item),
                      :method => :delete,
                      :html => {
                        :class => 'base_i'
                      }
              %>
          </div>
        </div>
      </td>
    </tr>
  <% end %>
  <tr>
    <td align='right' colspan='10' class='total'>合计：<b>￥<%= number_with_precision DesignerWorkItem.sum(:should_be_payed, :conditions => { :stage_id => stage.id, :work_item_type_id => type.id, :designer_id => designer.id }), :precision => 1 %></b></td>
    <td class='hidden'></td>
  </tr>
</table>